package net.hangar5.xmlrpc;

/* Imethod.java

The contents of this file are subject to the Mozilla Public
License Version 1.1 (the "License"); you may not use this file
except in compliance with the License. You may obtain a copy of
the License at http://www.mozilla.org/MPL/

Software distributed under the License is distributed on an "AS
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
implied. See the License for the specific language governing
rights and limitations under the License.

The Original Code is "Hangar5 XMLRPC Library".

The Initial Developer of the Original Code is James D. Rudnicki.  
Portions created by James D. Rudnicki are
Copyright (C) 2001.  All Rights Reserved.

Contributor(s): 
*/
import java.util.Vector;

/**
 * IMethod is the interface for all methods that can be used
 * with the Dispatcher.  
 */
public interface IMethod {

  /** Remote call entry point.
   *
   * Note: When implementing IMethods, keep thread safety in mind.
   * This method can be executed by multiple callers at the same
   * time with different parameters.  Thread safety can be achieved
   * simply by using only local variable.  Otherwise, you will need to
   * synchronize access to shared data.
   *
   * @param params A Vector of the methods parameters.
   * @return The return object. Currently, Integer, Double, String, byte[], or
   * Vectors containing these can be returned.
   */
  public Object execute( Vector params ) throws RpcException;  
  /** Methods full name.
   * The method name must be unique.  The client will
   * call the method with this name.
   */
  public String getName();  
  /**
   * Server shutdown notification.
   * The Dispatcher will call this method before the entire server
   * closes.  This allows clean shutdown of methods that may open
   * serial ports, sockets, start threads, or have allocated other
   * resources.
   *
   */
  public void shutdown();  
}
